<?php

	/**
	 * @package AmpleHarvest
	 */
	/**
	 * @brief This class controls the whole Classification Object
	 *
	 * - Revision History
	 *  - 0.1
	 * 	 - <b>Date</b>: 20 MAY 2011
	 * 	 - <b>Author</b>: Randy Blancett
	 * 	  - Initial Version
	 *
	 * @author Randy Blancett
	 * @version 0.1
	 * @ingroup code classes
	 */
	class cMarkings
	{
		const C_STR_UNCLASSIFIED = 'UNCLASSIFIED';
		
		private $m_str_Classification = '';
		private $m_arr_SCI = null;
		private $m_arr_Distro = null;
		private $m_bool_isDynamic = true;
		private $m_arr_Steward = null;
		private $m_arr_Publisher = null;
		private $m_arr_LastModified = null;
		private $m_arr_LastReviewed = null;
		
		

		public function __construct($str_Classification = null, $str_SCI = null, $str_Distro = null, $bool_Dynamic = false)
		{
			$this->m_arr_Distro = array();
			$this->m_arr_SCI = array();
			
			$this->set_Dynamic($bool_Dynamic);

			if ($str_Classification)
			{
				$this->set_Classification($str_Classification);
			}

			if ($str_SCI)
			{
				$this->set_SCI($str_SCI);
			}

			if ($str_Distro)
			{
				$this->set_Distro($str_Distro);
			}

		}
		
		public function set_Dynamic($bool_Dynamic=true)
		{
			$this->m_bool_isDynamic = $bool_Dynamic;
		}

		public function set_SCI($mix_SCI)
		{
			if (!is_array($mix_SCI))
			{
				$mix_SCI = Array($mix_SCI);
			}
			$this->clear_SCI();
			foreach ($mix_SCI as $str_SCI)
			{
				$this->add_SCI($str_SCI);
			}
		}

		public function set_Classification($str_Classification)
		{
			$this->m_str_Classification = strtoupper($str_Classification);
		}

		public function clear_SCI()
		{

			$this->m_arr_SCI = array();
		}

		public function add_SCI($str_SCI)
		{

			$this->m_arr_SCI[] = strtoupper($str_SCI);
		}

		public function set_Distro($mix_Distro)
		{
			if (!is_array($mix_Distro))
			{
				$mix_Distro = Array($mix_Distro);
			}
			$this->clear_Distro();
			foreach ($mix_Distro as $str_Distro)
			{
				$this->add_Distro($str_Distro);
			}
		}

		public function clear_Distro()
		{

			$this->m_arr_Distro = array();
		}

		public function add_Distro($str_Distro)
		{

			$this->m_arr_Distro[] = strtoupper($str_Distro);
		}

		public function get_OverallEmailBanner()
		{
			$str_Output = "Classification: ";
			$str_Output .= $this->m_str_Classification;

			if (sizeof($this->m_arr_SCI) > 0)
			{
				$str_Output .= "/";

				foreach ($this->m_arr_SCI as $str_SCI)
				{
					$str_Output .= "/" . $str_SCI;
				}
			}

			if (sizeof($this->m_arr_Distro) > 0)
			{
				$str_Output .= "/";

				foreach ($this->m_arr_Distro as $str_Distro)
				{
					$str_Output .= "/" . $str_Distro;
				}
			}

			return $str_Output."\n";
		}
	}
